Skip to main content

PutBucketLifecycle

Description

the owner of the bucket can set the Lifecycle configuration of the bucket by PutBucket the Lifecycle. After the Lifecycle is enabled, OSS will automatically delete objects that match the Lifecycle rules according to the configuration.

Request Method

POST

Request Path

/apsara/route/OneRouter/PutBucketLifecycle

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
StatusBODYstringYesEnabledIf the value is Enabled, OSS will periodically execute the rule; If it is Disabled, OSS will ignore the rule.
ExpirationBODYcontainerNonot involvedspecifies the expiration attribute of the object lifecycle rule.
LifecycleConfigurationBODYcontainerYesnot involvedLifecycle configured container can hold up to 1000 rules.
PrefixBODYstringYesdataspecifies the prefix (Prefix) to which the rule applies. Prefix is not repeatable. If Prefix is specified, this rule only applies to objects in Bucket that match Prefix. If Prefix is left blank, this rule applies to all objects in the Bucket.
versionBODYstringNo2016-01-01version of api
AbortMultipartUploadBODYcontainerNonot involvedspecifies the expired attribute of incomplete multipart upload.
CreatedBeforeDateBODYstringNo2002-10-11T00:00:00.000ZSpecify a date, and OSS will execute lifecycle rules on data whose last update time is earlier than that date. The date must obey the ISO8601 format and must be the zero point of UTC. for example: 2002-10-11T00:00:00.000Z, which means that objects with the last update time earlier than 2002-10-11T00:00:00.000Z are deleted or converted to other storage types, and objects equal to or later than this time will not be deleted or dumped.
regionIdBODYstringYesNo sample value for this parameter.region id
DaysBODYpositive integerNo1specifies how many days after the lifecycle rule takes effect from the last update of Object.
ValueBODYstringNo1Tag Value
IDBODYstringNorule1unique ID that identifies the rule. It consists of up to 255 bytes. If it is not specified or the value is empty, OSS automatically generates a unique ID.
RuleBODYcontainerYesnot involvedidentifies a rule.
TagBODYcontainerNonot involvedspecifies the object label to which the rule applies, and multiple labels can be set.
KeyBODYstringNoxxTag Key

Return data

NameTypeSample valueDescription
RequestIDstring1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DCRequest id

Example

Successful Response example

{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}